local player = GAMESTATE:GetMasterPlayerNumber();

function setFont(self, param)
	local st = GAMESTATE:GetCurrentStyle():GetStepsType()
	if self.ParamSong then
		if GAMESTATE:GetCurrentSteps(player) then
			local diff = self.ParamSong:GetOneSteps( st, GAMESTATE:GetCurrentSteps(player):GetDifficulty())
			local diffname = ToEnumShortString(GAMESTATE:GetCurrentSteps(player):GetDifficulty());
			if diff then
				self:settext(diff:GetMeter())
				self:visible(true)
				self:diffuse(_G.diffColors[diffname]);

			else
				--N as in Not as in difficulty not found
				self:settext("")
				--self:diffuse(color("#c3a545"))
			end
		end
	else
		--B for Bad as in cant find song
		self:settext("")
		--self:diffuse(color("#c3a545"))
	end
end;

local t = Def.ActorFrame{

}

t[#t+1] = Def.ActorFrame{
	--[[Def.Quad{
		InitCommand=cmd(setsize,SCREEN_WIDTH/3,3;horizalign,left;addy,13;faderight,.7);
	};]]
	--[[Def.Quad{
		InitCommand=cmd(setsize,SCREEN_WIDTH/3,4;horizalign,left;addy,20;faderight,.7);
	};]]
	
	InitCommand=cmd(x,50);
	LoadFont("Serif")..{
		InitCommand=cmd(vertalign,bottom;horizalign,left;zoom,1;maxwidth,350);
		SetCommand=function(self, params)
			local song = params.Song
			if song then
				self:settext(song:GetDisplayMainTitle());
			end;
		end;
		CurrentSongChangedMessageCommand=function(self)
            self:queuecommand("Set");
        end;
	
	};
	LoadFont("Serif")..{
		InitCommand=cmd(vertalign,top;horizalign,left;y,7;zoom,.8;maxwidth,300);
		SetCommand=function(self, params)
			local song = params.Song
			if song then
				self:settext(song:GetDisplayArtist());
			end;
		end;
		CurrentSongChangedMessageCommand=function(self)
            self:queuecommand("Set");
        end;
	
	};
};

t[#t+1] = Def.ActorFrame{
	InitCommand=cmd(x,SCREEN_WIDTH*.4);
	
	LoadFont("Common Label")..{
		Text="000";
		InitCommand=cmd(x,55;horizalign,left;shadowcolor,Color("Black");shadowlength,1);
		CurrentSongChangedMessageCommand=function(self) setFont(self) end;
		CurrentStepsP1ChangedMessageCommand=function(self) setFont(self) end;
		CurrentStepsP2ChangedMessageCommand=function(self) setFont(self) end;
		SetCommand=function(self,param)
			self.ParamSong = param.Song
			setFont(self)
		end;
	};
	
	LoadFont("Common Label")..{
		Text="Lv.";
		InitCommand=cmd(horizalign,left;shadowcolor,Color("Black");shadowlength,1);
	};

};

return t;
